package com.dialogonota;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.dialogonota.NumberPickerDialog;
import com.dialogonota.R;

public class CambioNotaActivity extends Activity implements NumberPickerDialog.OnNumberSetListener {
    TextView nota;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        nota=(TextView)findViewById(R.id.Nota);
    }

    public void abrir (View v) {
            NumberPickerDialog dialog = new NumberPickerDialog(this, -1, 5);
            dialog.setTitle(getString(R.string.dialog_picker_title));
            dialog.setOnNumberSetListener(this);
            dialog.show();
    }

    public void onNumberSet(int number) {
        nota.setText(String.valueOf(number));
    }
}